﻿using Iworld.Backstage.Framework;
using Iworld.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Iworld.Backstage
{
    /// <summary>
    /// 错误弹窗
    /// </summary>
    [Pop(Pop.错误信息)]
    public partial class ErrorPrompt : ChildWindow, IPop<string>
    {
        public ErrorPrompt()
        {
            InitializeComponent();
        }

        public string Info
        {
            get { return (string)GetValue(InfoProperty); }
            set { SetValue(InfoProperty, value); }
        }

        public static readonly DependencyProperty InfoProperty =
            DependencyProperty.Register("Info", typeof(string), typeof(ErrorPrompt)
            , new PropertyMetadata("", (d, e) =>
            {
                ErrorPrompt tool = (ErrorPrompt)d;
                tool.text_content.Text = e.NewValue.ToString();
            }));

        /// <summary>
        /// 确认
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Enter(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }
}

